package com.yunpeng.dishes.dao.mapper.entity;

import com.yunpeng.dishes.dao.mapper.IBaseMapper;
import com.yunpeng.dishes.dao.model.CodeNameDO;
import com.yunpeng.dishes.dao.model.entity.FoodIngredientsDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * IFoodIngredientsMapper
 *
 * @author : Moore(hemw)
 * @date : 2020-03-26
 */
@Mapper
public interface IFoodIngredientsMapper extends IBaseMapper<FoodIngredientsDO> {

    /**
     * 根据name获取实体
     *
     * @param name
     * @return
     */
    FoodIngredientsDO getByName(String name);

    /**
     * 根据食材代码获取食材列表
     *
     * @param codes
     * @return
     */
    List<FoodIngredientsDO> queryForListByCodes(@Param(value = "codes") List<String> codes);

    /**
     * 查询code name映射
     *
     * @param name
     * @return
     */
    List<CodeNameDO> queryFoodNames(@Param(value = "name") String name);
}
